package org.builder.web.mvc;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.builder.service.TaskService;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

public class MainController extends MultiActionController {

	private TaskService taskService = null;
	
	private String mainView = null; 
	
	public ModelAndView main(HttpServletRequest request,HttpServletResponse response) throws Exception{
		Map tasks = taskService.getTasks();
		Map model = new HashMap();
		model.put("taskList", tasks);
		
		return new ModelAndView(mainView,model);
		
	}

	public void setMainView(String mainView) {
		this.mainView = mainView;
	}


	public void setTaskService(TaskService taskService) {
		this.taskService = taskService;
	}
}
